
package com.kugou.game.sdk.ui.dialog;

import com.kugou.game.sdk.utils.Rx;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;

/**
 * 描述:退出广告弹出框
 * 
 * @author liux
 * @since 2015-3-17 上午11:26:55
 */
public class ExitAdDialog extends AbsDialog {

    private ImageView img;

    public ExitAdDialog(Activity activity) {
        super(activity);
    }

    @Override
    protected View createContentView() {
        LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(
                Context.LAYOUT_INFLATER_SERVICE);
        View contentView = inflater.inflate(Rx.layout.kg_single_exit_ad_dialog, null);
        img = (ImageView) contentView.findViewById(Rx.id.kg_exit_dialog_ad_image);
        return contentView;
    }

    /**
     * 设置图片的点击事件
     * 
     * @param listner
     */
    public void setImageClickListener(View.OnClickListener listner) {
        if (listner != null) {
            img.setOnClickListener(listner);
        }
    }

    public void setImageResource(int resid) {
        img.setImageResource(resid);
    }

    public void setImageBitmap(Bitmap bm) {
        img.setImageBitmap(bm);
    }
}
